<template>
  <div>
    <button @click="changeOb">修改provide</button>
    <provide-son/>
  </div>
</template>

<script>
import { defineComponent,provide, ref } from "vue";
import provideSon from './components/provide-son'

export default defineComponent({
  components:{
    provideSon
  },
  setup(){
    const ob = ref('被监控的provide')
    provide('foo','111')
    provide('ob',ob)

    return {
      changeOb:()=>{
        ob.value = 'provide被修改了'
      }
    }
  }
})
</script>